package com.xinqi.modules.stats.score.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.mybatis.data.service.impl.BaseServiceImpl;
import com.xinqi.common.mybatis.utils.Pages;
import com.xinqi.modules.stats.score.domain.CourseTotalScoreOfflineStudentEntity;
import com.xinqi.modules.stats.score.dto.req.CourseContentTotalScoreClassDTO;
import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreOfflineStudentQueryDTO;
import com.xinqi.modules.stats.score.dto.rsp.CourseTotalScoreOfflineStudentResultDTO;
import com.xinqi.modules.stats.score.mapper.CourseTotalScoreOfflineStudentMapper;
import com.xinqi.modules.stats.score.service.CourseTotalScoreOfflineStudentService;
import feign.Param;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 线下成绩学生表服务层实现
 *
 * @author: system
 * @date: 2023/03/26
 */
@Service("courseTotalScoreOfflineStudentService")
@RequiredArgsConstructor
public class CourseTotalScoreOfflineStudentServiceImpl extends BaseServiceImpl<CourseTotalScoreOfflineStudentMapper, CourseTotalScoreOfflineStudentEntity> implements CourseTotalScoreOfflineStudentService {


    @Override
    public List<CourseTotalScoreOfflineStudentResultDTO> studentOfflineScoreList(CourseTotalScoreOfflineStudentQueryDTO query) {
        return this.baseMapper.studentOfflineScoreList(query);
    }

    @Override
    public PageInfo<CourseTotalScoreOfflineStudentResultDTO> studentOfflineScorePage(Page page, @Param("query") CourseTotalScoreOfflineStudentQueryDTO query) {
        return Pages.convert(this.baseMapper.studentOfflineScorePage(page, query));
    }

    @Override
    public CourseTotalScoreOfflineStudentResultDTO studentOfflineScore(CourseTotalScoreOfflineStudentQueryDTO query) {
        return this.baseMapper.studentOfflineScore(query);
    }

    @Override
    public Long studentUnRead(CourseContentTotalScoreClassDTO dto) {
        return this.baseMapper.studentUnreadOfflineScore(dto);
    }

    @Override
    public boolean studentReadOffline(CourseContentTotalScoreClassDTO dto) {
        this.baseMapper.studentReadOfflineScore(dto);
        return true;
    }


}
